package com.TanNgee.serviceimpl;

import com.TanNgee.Hello;
import com.TanNgee.HelloService;
import com.TanNgee.annotation.RpcService;
import lombok.extern.slf4j.Slf4j;

/**
 * 服务提供方
 *
 * @author 陈毅
 * @create 2022/3/23 15:58
 *
 */
@Slf4j
//指明服务接口和服务版本，发布服务到ZK上，会根据这个两个元数据注册
@RpcService(group = "test1", version = "version1")
public class HelloServiceImpl implements HelloService {
    static {
        System.out.println("HelloServiceImpl被创建");
    }

    @Override
    public String hello(Hello hello) {
        log.info("HelloServiceImpl收到: {}.", hello.getMessage());
        String result = "Hello description is " + hello.getDescription();
        log.info("HelloServiceImpl返回: {}.", result);
        return result;
    }
}
